<?php


namespace app\api\controller;


use think\Request;

class Citys extends Base
{
    public function getCitysList(Request $request){
        $res = [];
        $pid = $request->post('pid');
        if($pid == null){
            $res['status'] = 400;
            echo json_encode($res);die;
        }
        $citys = new \app\admin\model\Citys();
        $where['pid'] = $pid;
        $rs = $citys->getAll($where);
        if($rs == null){
            $res['data']['code'] = 0;
            $res['data']['msg'] = '获取失败';
        }else{
            $res['data']['code'] = 1;
            $res['data']['msg'] = '获取成功';
            $res['data']['list'] = $rs;
        }
        $res['status'] = 200;
        echo json_encode($res);
    }
}